package com.qqtop10.manager.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qqtop10.manager.dao.GoodsMapper;
import com.qqtop10.manager.model.PagingArgs;
import com.qqtop10.manager.model.temp.BuildIndexGoodsTemp;
import com.qqtop10.manager.model.temp.Goods;
import com.qqtop10.manager.service.GoodsService;

@Service("goodsService")
public class GoodsServiceImpl extends BaseService implements GoodsService {
	@Autowired
	private GoodsMapper goodsMapper;

	@Override
	public boolean recommend(Goods input) {
		return goodsMapper.recommend(input) != 0;
	}

	@Override
	public List<Goods> selectByCategoryUuid(String categoryUuid) {
		return goodsMapper.selectByCategoryUuid(categoryUuid);
	}

	@Override
	public List<Goods> selectByShopUuid(String shopUuid) {
		return goodsMapper.selectByShopUuid(shopUuid);
	}

	@Override
	public List<Object> selectBySelective(Map<String, Object> map) {
		return goodsMapper.selectBySelective(map);
	}

	@Override
	public int count(Map<String, Object> map) {
		return goodsMapper.count(map);
	}

	@Override
	public int removeRecommendByUuid(List<String> uuids) {
		return goodsMapper.removeRecommendByUuid(uuids);
	}

	@Override
	public Goods selectByName(String name) {
		return goodsMapper.selectByName(name);
	}

	@Override
	public List<Goods> getAllGoods(PagingArgs pagingArgs) {
		return goodsMapper.getAllGoods(pagingArgs);
	}

	@Override
	public Goods selectGoodsByUUID(String uuid) {
		return goodsMapper.selectGoodsByUUID(uuid);
	}

	@Override
	public int updateGoodsIsBoutique(Map<String, Object> map) {
		return goodsMapper.updateGoodsIsBoutique(map);
	}

	@Override
	public int allGoodsCount() {
		return goodsMapper.allGoodsCount();
	}

	@Override
	public List<Goods> selectGlobalShoppingGoodsByCountryId(int id) {
		return goodsMapper.selectGlobalShoppingGoodsByCountryId(id);
	}

	@Override
	public List<BuildIndexGoodsTemp> selectBuildIndexPageGoods() {
		PagingArgs pagingArgs = null;
		List<BuildIndexGoodsTemp> list = null;
		try {
				list = goodsMapper.selectBuildIndexPageGoods();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}

	@Override
	public List<String> getAllGoodsUuid() {
		return goodsMapper.getAllGoodsUuid();
	}

	@Override
	public int qqgBoutiqueByGoodsUuid(Map<String, Object> map) {
		return goodsMapper.qqgBoutiqueByGoodsUuid(map);
	}

	@Override
	public List<Goods> getAllQQGGoods(PagingArgs pagingArgs) {
		return goodsMapper.getAllQQGGoods(pagingArgs);
	}

	@Override
	public Integer allQQGGoodsCount() {
		return goodsMapper.allQQGGoodsCount();
	}
	
}
